<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>立项查看</title>
    <link rel="stylesheet" href="/lims/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lims/css/common.css">
    <script src="/lims/layui/layui.js"></script>
    <script type="text/javascript" src="/lims/layui/global.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <style>
        .mbox {
            padding: 8px;
        }
        #customerInfo tr{
            height: 46px !important;
            line-height: 46px;
        }
        #customerInfo tr td{
            height: 38px;
            padding: 4px 15px;
        }
        #projectInfo tr{
            height: 46px !important;
            line-height: 46px;
        }
        #projectInfo tr td{
            height: 38px;
            padding: 4px 15px;
        }
        .layui-table-view .layui-table td, .layui-table-view .layui-table th {
            padding: 3px 0;
        }
        .layui-tab-item{
            height: 100%;
        }
    </style>
</head>
<body>
<div class="mbox" style="padding-bottom: 100px;">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 10px 13px;">
            <table id="Settlement"  lay-filter="SettlementFilter"></table>
        </div>
    </div>
</div>

<script type="text/html" id="barOperation">
    <a class="layui-btn layui-btn-xs" lay-event="look" id="look">查看</a>
</script>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container" >
        <button class="layui-btn layui-btn-sm" lay-event="search" style="width: 70px">高级搜索</button>
        <button class="layui-btn layui-btn-sm" lay-event="export" style="width: 70px">导出</button>
    </div>
</script>
<script type="text/javascript">
    layui.use(['table', 'layer', 'form', 'element'], function () {
        var table = layui.table;
        var layer = layui.layer;

        var  settlementTable = table.render({
            elem: '#Settlement'
            , url: '/limsProjectview/projectviewdata' //数据接口
            , page: {
                layout: ['prev', 'page', 'next', 'skip', 'count', 'limit',]//自定义分页布局
                , limits: [15, 30, 45, 60, 75, 90, 105, 120]
                , first: false //不显示首页
                , last: false //不显示尾页
            } //开启分页
            , toolbar: '#toolbar'
            , cols: [[ //表头
                {type: 'checkbox'}
                , {type: 'numbers', title: '序号'}
                , {field: 'projectNo', title: '立项编号'}
                , {field: 'customerName', title: '客户名称'}
                , {field: 'projectName', title: '项目名称'}
                , {field: 'delegateDate', title: '委托日期',templet: function(d) {
                        if( d.delegateDate==undefined || d.delegateDate ==""){
                            return d.delegateDate =""
                        } else{
                            d.delegateDate=new Date(d.delegateDate).Format("yyyy-MM-dd");
                            return d.delegateDate;
                        }
                    }}
                , {field: 'reportDeadline',hide:true, title: '应出报告日期',templet: function(d) {
                        if( d.reportDeadline==undefined || d.reportDeadline ==""){
                            return d.reportDeadline =""
                        } else{
                            d.reportDeadline=new Date(d.reportDeadline).Format("yyyy-MM-dd");
                            return d.reportDeadline;
                        }
                    }}
                , {field: 'customerManagerId', title: '客户经理',templet: function(d) {
                        if( d.customerManagerId=="admin"){
                            return d.updateName
                        } else{
                            return ""
                        }
                    }}
                , {field: 'runId', title: '流水号'}
                , {field: 'updateName', title: '创建人',hide:true}
                , {field: 'updateTime',hide:true,title: '创建时间',templet: function(d) {
                        if( d.updateTime==undefined || d.updateTime ==""){
                            return d.updateTime =""
                        } else{
                            d.updateTime=new Date(d.updateTime).Format("yyyy-MM-dd");
                            return d.updateTime;
                        }
                    }}
                , {field: 'memo', title: '备注',hide:true}
                , {fixed: 'right', width: 170, title: '操作', align: 'center', toolbar: '#barOperation'}
            ]]
            , limit: 15
            , done: function (res) {
            }
        });

        table.on('tool(SettlementFilter)', function (obj) {
            var data = obj.data;
            var layEvent = obj.event;
            var projectId=data.projectId;
            if(layEvent ==='look'){
                layer.open({
                    type: 1,
                    skin: 'layui-layer-rim', //加上边框
                    area: ['100%', '100%'],  //宽高
                    title: '委托单',
                    maxmin:true,
                    anim: 2,
                    content:'<div class="layui-card" style="margin:0;height: 100%">'+
                        '<div class="layui-tab layui-tab-brief" lay-filter=""style="height: 100%;">'+
                        '<ul class="layui-tab-title">'+
                        '<li><span style="font-size: 16px">基本信息</span></li>'+
                        '<li><span style="font-size: 16px">产品/试验信息</span></li>'+
                        '<li><span style="font-size: 16px">需求分析</span></li>'+
                        '<li><span style="font-size: 16px">外包/外协/外购</span></li>'+
                        '<li><span style="font-size: 16px">报价信息</span></li>'+
                        '<li><span style="font-size: 16px">操作细则</span></li>'+
                        '<li class="layui-this"><span style="font-size: 16px">报告生成</span></li>'+
                        '<li><span style="font-size: 16px">附件</span></li>'+
                        '</ul>'+
                        '<div class="layui-tab-content" style="padding-top: 0;padding-bottom: 0;height: 100%">'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_input/basicInfo?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_input/productInfo?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_task/analysis?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_task/outsource?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_quotation/tabQuotation?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_steps/addRules?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item layui-show"><iframe style="width: 100%;height:100%;" frameborder="no" src="/project_report/showReportGeneration?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '<div class="layui-tab-item"><iframe  id="lookFile" style="width: 100%; height:100%" frameborder="no" src="/project_input/proappendix?projectId='+projectId+'&begin=look"></iframe></div>'+
                        '</div></div></div>',
                    success: function (res) {
                    }
                })
            }
        });
    })
</script>
</body>
</html>
